作者:猪猪情系qq | 来源:互联网 | 2023-05-18 12:18
Iwroteaphpscript.Iwantitshowhelpmessagewhencalledwithstandardinputconnectedtoatty
I wrote a php script. I want it show help message when called with standard input connected to a tty device (terminal) before reading and executing interactively, but dont show when called with a file or stream from pipe as standard input.
我写了一个PHP脚本。我希望它在使用连接到tty设备(终端)的标准输入调用之前显示帮助消息,然后以交互方式读取和执行,但是在使用文件或来自管道的流作为标准输入调用时不显示。
Is there a way to detect this from PHP?
有没有办法从PHP中检测到这个?
2 个解决方案